﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Compiler.CompilerAPI
{
    public class DllLibInfo : IEquatable<DllLibInfo>
    {
        private string fileName;
        private bool exists;

        public string FileName
        {
            get { return fileName; }
        }
        public bool Exists
        {
            get { return exists; }
        }

        public DllLibInfo(string fileName)
        {
            if ((fileName == null) || (fileName == ""))
                throw new ArgumentOutOfRangeException("fileName can not be empty");
            this.fileName = fileName;
            this.exists = true;
        }

        public bool Check()
        {
            exists = System.IO.File.Exists(fileName);
            return exists;
        }

        public override int GetHashCode()
        {
            return fileName.GetHashCode();
        }

        public bool Equals(DllLibInfo other)
        {
            return this.fileName == other.fileName;
        }
    }
}
